import { Prop, Component } from 'vue-property-decorator';
import { AppmenuBase, VueLifeCycleProcessing } from 'ibiz-vue';
import './app-user-new-menu.less';
import { throttle } from 'ibiz-core';

@Component({})
@VueLifeCycleProcessing()
export class AppUserNewMenu extends AppmenuBase {


    /**
     * 绘制应用菜单
     *
     * @returns {*}
     * @memberof AppmenuBase
     */
    public render() {
      
      return <div class="app-user-new-menu">
        {this.menus.map((menu: any) => {
          return (!menu.hidden ? <div class="group">
            <div class="content">
              {
                (menu.getPSAppMenuItems && menu.getPSAppMenuItems.length > 0) 
                ? menu.getPSAppMenuItems.map((item: any) => {
                    return !item.hidden
                    ? <div class="item" on-click={ () => { throttle(this.click,[item],this) } }>
                      {item.getPSSysImage?.imagePath ? <img class='menu-icon' src={__webpack_public_path__ + item.getPSSysImage.imagePath} /> : null}
                      <div class="text">{ this.$tl(item.captionTag,item.caption) }</div>
                    </div>
                    :null
                }) 
                : null    
              }    
              <i></i><i></i><i></i><i></i><i></i><i></i>      
            </div>
          </div> : null)
        })}
      </div>
    }

}